package com.lu.library.base

/**
 * Created by lyw.
 *
 * @author: lyw
 * @package: com.ido.veryfitpro.base
 * @date: 2018/7/16 0016
 * EventBus  发送消息顶层类
 */
class BaseMessage<T> {
    constructor(type: Int, data: T) {
        this.type = type
        this.data = data
    }

    constructor(type: Int) {
        this.type = type
    }


    //    public static final int EVENT_TYPE_SYN_HEALTH=1;
    /**
     *
     * 消息类型
     */
    var type: Int

    /**
     * 消息数据
     */
    private var data: T? = null

    fun getData(): T? {
        return data
    }

    fun setData(data: T) {
        this.data = data
    }

    override fun toString(): String {
        return "BaseMessage{" +
                "type=" + type +
                ", data=" + data +
                '}'
    }
}
